<?php

/**
 * Created by PhpStorm.
 * User: joe
 * Date: 17-1-18
 * Time: 下午5:42
 */
class Category_model  extends CI_Model {

    public function __construct() {
        $this->load->database();
    }

    public function get($id=null,$select=null,$where=null) {
        if ($select) $this->db->select($select);
        if ($where) $this->db->where($where);
        if ($id) {
            return $this->db->get_where('category',['id'=>$id])->row_array();
        }
        return $this->db->get('category')->result_array();
    }

}